Categories

Versions

enerate Rank (In Database) (In-Database Processing)

Synopsis

This operator can generate the (dense) rank of each row within the given partition into a new column.

Description

The rank of a row is one plus the count of ranks before the given row. The dense rank of a row is one plus the count of distinct ranks before the given row. Note that if no partitioning is defined, the entire data set is sorted, a potentially slow operation for a large data set. For adding a unique ID variable to the data set, you may want to use your database-specific function instead, e.g. ROWNUM for Oracle.

Input

  • example set input

Output

  • example set output

Parameters

  • attribute_name Name of the attribute. Range: string
  • partition_by Ordered list of the partitioning attributes. Range: string
  • order_by The attributes and sorting directions which should be used to determine the order of the data before the ranking is applied. Range: list
  • dense_rank Dense Rank returns the rank of rows, within the partition of a result set, without any gaps in the ranking. Range: boolean